 <?php 
 foreach ($notess as $notes){
     $results[] = array(
         'id' => $notes->getNotescategoriesId(),
         'title'=>$notes->getTitle()
     );
 }
 
echo json_encode($results)
?>